package com.ihg.hiex.entity.user;

import org.apache.commons.lang3.StringUtils;

import com.demo2do.core.utils.Alias;

/**
 * 
 * @author dan
 *
 */
@Alias("ConversationStatus")
public enum ConversationStatus {
    
    NOT_SUBMITED("not_submited", "未提交", "conversation.status.1"),
    
    NOT_CONFIRMED("not_confirmed", "待确认", "conversation.status.2"),
    
    CONFIRMED("confirmed", "已确认", "conversation.status.3"),
    
    REJECTED("rejected", "已驳回", "conversation.status.4");
    
    private String alias;
    
    private String description;
    
    private String message;

    /**
     * 
     * @param alias
     * @param description
     */
    private ConversationStatus(String alias, String description, String message) {
        this.alias = alias;
        this.description = description;
        this.message = message;
    }
    
    /**
     * 
     * @param alias
     * @return
     */
    public static ConversationStatus aliasOf(String alias) {
        for (ConversationStatus conversationStatus : ConversationStatus.values()) {
            if(StringUtils.equalsIgnoreCase(conversationStatus.getAlias(), alias)) {
                return conversationStatus;
            }
        }
        return null;
    }
    
    /**
     * 
     * @return
     */
    public boolean isNotSubmited() {
        return this.equals(NOT_SUBMITED);
    }
    
    /**
     * 
     * @return
     */
    public boolean isConfirmed() {
        return this.equals(CONFIRMED);
    }
    
    /**
     * 
     * @return
     */
    public boolean isNotConfirmed() {
        return this.equals(NOT_CONFIRMED);
    }
    
    /**
     * 
     * @return
     */
    public boolean isRejected() {
        return this.equals(REJECTED);
    }

    /**
     * @return the alias
     */
    public String getAlias() {
        return alias;
    }

    /**
     * @return the description
     */
    public String getDescription() {
        return description;
    }

    /**
     * @return the message
     */
    public String getMessage() {
        return message;
    }

    /**
     * @param alias the alias to set
     */
    public void setAlias(String alias) {
        this.alias = alias;
    }

    /**
     * @param description the description to set
     */
    public void setDescription(String description) {
        this.description = description;
    }

    /**
     * @param message the message to set
     */
    public void setMessage(String message) {
        this.message = message;
    }
}